import { defineStore } from "pinia"

const useCountStore = defineStore('count', {
    state: () => ({
        count: 0,
        name: 'count',
        message: 'hello pinia'
    }),
    actions: {
        increment(value: number) {
            this.count += value
        },
        decrement(value: number) {
            this.count -= value
        }
    },
    getters: {

        doubleCount: (state) => state.count * 2,

        upperMessage(): string {
            return this.message.toUpperCase()
        }
    }
})

export default useCountStore
